/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itsc.ds2.bl;

import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import mx.itsc.ds2.dao.SalesDaoLocal;
import mx.itsc.ds2.enumerations.TransactionStatus;
import mx.itsc.ds2.model.Sales;

/**
 *
 * @author Eli
 */
@Stateless
public class SaleBl implements SaleBlLocal {
    @EJB
    private SalesDaoLocal salesDao;

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

    @Override
    public TransactionStatus register(Sales sale) {
       if(sale.getIdsale()!=null){
       salesDao.create(sale);
       return TransactionStatus.COMPLETE;
       }else{
       return TransactionStatus.INCOMPLETE;
       }
    }

//    @Override
//    public TransactionStatus modify(Sales sale) {
//        return null;
//    }
//
//    @Override
//    public TransactionStatus delete(Sales sale) {
//        return null;
//    }

    @Override
    public List<Sales> getAll() {
        return salesDao.findAll();
    }

    
}
